feat(agent): forge state-transition tools (RIG-3331) - #1019
Open
rigel-mintaka wants to merge 1 commit into
Open
Conversation
This was referenced Sep 8, 2026
|
Compass engineering docs preview: https://compass-forge-rig-3331-tools.compass-eng-docs.pages.dev Deployed from |
rigel-mintaka
force-pushed
the
compass-forge/rig-3331-tools
branch
from
September 8, 2026 21:08
1d46bf2 to
54a0ef1
Compare
rigel-mintaka
marked this pull request as ready for review
September 8, 2026 21:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is part of a stack containing 6 PRs:
mainImplements T6 of
docs/designs/server/compass-forge-state-transition/design.md: the two agent tools. Stacked on #1018.forge_transition_issue_stateandforge_transition_pull_request_state, on the DL-241 single-purpose-tool pattern over the sameForgeBrokerseam every existing forge tool uses.The tool-facing parameter is
pull_number, matching every other PR tool in the file, and maps to the proto'spr_numberat the request boundary — agent-facing consistency over wire-name symmetry.Schema semantics follow the record:
reporequired (<owner>/<name>on GitHub, team key on Linear),stateisopenorclosed,close_reasonGitHub-issues-only,workflow_stateLinear-only. The PR tool takes no refinement fields —close_reasonis a GitHub issue concept, and merge is a separate concern never expressed as a transition.Tests
Broker round-trips asserting the request arm and its fields, and that the rendered result is the post-transition artifact. Plus schema-rejection tests pinning the portable state domain:
mergedand a Linear workflow-state name are both real forge states and neither is a legal target.The three native-tool count tripwires in
cli.test.tsmove 20 → 22. That is what a tripwire is for — it caught the roster change rather than letting the tools land unnoticed.Verified:
compass-agent:test684 pass / 0 fail;compass-agent:typecheckclean.Ledger-impact: none — DL-342/DL-343 landed with the record's freeze in #981.
Review round 1 — resolved
Reviewed by the
reviewagent over the whole stack (high 3, medium 7, low 6).The core RIG-3331 mechanism (memo ordering, one-shot consume, tenant isolation,
provider methods, Linear resolution, error mapping, recorded-state choice) was
verified correct. All three highs were stack-integration regressions, now fixed:
main; every conflict resolved by regenerating (buf+sqlc), never byhand-merging a generated file.
SessionErrorregen (45 -> 0 occurrences). The regen restores it:SessionErroris back to 45 in
go/gen/compass/v1/compass.pb.goand 14 in the agent TS,with
ownerHandleand the transition arms additive on top.approvalOfloop over all twelve tools (3 reads + 9 writes) with its justification comment,
rather than the two-tool assertion that replaced it.
Mediums fixed:
updated_at/created_at+updated_at_tablesentry forforge_state_transitions(main's RIG-3495 convention, which landed after thisbranched) plus a sqlc regen; the single-column FK divergence documented; the
memo coordinate contract documented on
rememberTransition; the memo-failureerror now names the forge write that landed; the Linear retry gate narrowed to
the actual staleness signal; workflow-state page truncation now fails loud at
422; the two transition schemas routed through the
compassv1barrel.Both new provider tests were mutation-proved: widening the retry gate reddens
TestLinearTransitionDoesNotRetryOnNonStaleness200, and removing the truncationguard reddens
TestLinearTransitionRejectsTruncatedWorkflowStatePage.Gate:
moon ci70 actions, 0 failed againstMOON_BASE=origin/main.The initial
forgelive-oracle 401s were mint contention, not a defect: theLinear
client_credentialsapp holds one active token, so five concurrent CIruns each revoked the previous one's (which is why the last-to-mint PR was
green). Re-run serially, the job passes on every head with no code change.